<template>
  <div>
<h1>修改页面{{cid}}</h1>
<p>分类名：<input type="text" v-model="name"></p>
<p><input type="button" value="修改" @click="upcate"></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
          cid:this.$route.query.cid,
          name:'',
        }
    },
    methods:{
      upcate() {
        let fdata=new FormData()
        fdata.append('name',this.name)
        axios({
          url:'http://127.0.0.1:8000/app01/upcate/'+this.cid,
          method:'put',
          data:fdata
        }).then(resp=>{
          console.log(resp.data)
        })
      }
    }
}
</script>

<style>

</style>